package com.yz.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BlogCategory {
    private Integer id;
    private String name;
    //该分类下有多少篇文章
    private Integer count;
    private Date createTime;

    // 用于将格林时间转换为我们看得懂的
    public String getCreateTime(){
        SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return df.format(this.createTime);
    }
}
